package org.summerframework.component.security.oauth.wechat;

import org.summerframework.component.security.oauth.LoginType;
import org.summerframework.component.security.oauth.OAuthAppIdAndAppSecret;

public class WechatMpOAuthSupper extends AbstractWechatOAuthSupper implements WechatOAuthInterceptor {

    private final WechatMpAppIdAndAppSecret wechatMpAppIdAndAppSecret;

    public WechatMpOAuthSupper(WechatMpAppIdAndAppSecret wechatMpAppIdAndAppSecret) {
        this.wechatMpAppIdAndAppSecret = wechatMpAppIdAndAppSecret;
    }

    @Override
    public OAuthAppIdAndAppSecret getOAuthInfo() {
        return wechatMpAppIdAndAppSecret;
    }

    @Override
    public boolean supportsType(LoginType loginType) {
        return LoginType.WECHAT_MP == loginType;
    }
}
